﻿using AMInstantMessagingServerAPICall;
using AMInstantMessagingServerAPIModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AMInstantMessaging
{
    public partial class FormMain : Form
    {
        public FormMain()
        {
            InitializeComponent();
        }

        UserControllerCall _UserControllerCall = new UserControllerCall();

        private void button_login_Click(object sender, EventArgs e)
        {
            // 尝试登录
            // 初始化UDP，尝试连接服务器

            var statusdata = _UserControllerCall.Login(new LoginEditModel { UserName = textBox_user_name.Text, Password = textBox_password.Text });
            if (statusdata.Status != BaseSimpleAPI.StatusDataStatus.Success)
                MessageBox.Show(statusdata.Message);
            else
                MessageBox.Show("登录成功了撒");
        }

        private void linkLabel_create_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FormCreate form_create = new FormCreate();
            form_create.ShowDialog();
        }
    }
}
